# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pyusb
_pkgname=pyusb
pkgdesc='USB access on Python.'
pkgver=1.0.2
pkgrel=3
arch=('any')
url='https://github.com/pyusb/pyusb'
license=('custom:unknown')
depends=('python2' 'libusb')
makedepends=('python2-distribute')
source=("$_pkgname-$pkgver.tar.gz::https://pypi.org/packages/source/p/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('218d118c8572ed548d2317725a9717c0a442eb67c05148ccd90505a407bd8821a1519f511abc14f96b8e09d914f5a35f57cfabd57c47cb9b3fcd8b61947375a2')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" -O1 --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

